<template>
    <div>
        <span v-text="str"></span>
        <br>
        <p v-text="str + 'wasd'"></p>
        <button @click="setText(123)">设置值123</button>
    </div>
</template>

<script>
    export default {
        name: "DemoVtext",
        data() {
            return {
                str: '',
            }
        },
        methods: {
            setText(val) {
                this.str = val;
            }
        }
    }
</script>

<style scoped>

</style>